﻿using System.Collections.ObjectModel;
using MugenInjection.Interface;
using MugenInjection.Interface.Components;

namespace MugenInjection.Xml.Interface.Components
{
    /// <summary>
    /// Represents the component to add support load bindings from xml.
    /// </summary>
    public interface IXmlBindingLoaderComponent : IComponent
    {
        /// <summary>
        /// Gets the loaded modules.
        /// </summary>
        ReadOnlyCollection<string> Modules { get; }

        /// <summary>
        /// Gets or sets the <see cref="IXmlBindingReader"/> for read bindings.
        /// </summary>
        IXmlBindingReader XmlBindingReader { get; set; }

        /// <summary>
        /// Loads a series instances of <see cref="IBinding"/> from xml.
        /// </summary>
        /// <param name="xml">The specified xml for load bindings.</param>
        /// <param name="moduleName">The specified module name for load, default used from xml.</param>
        void LoadBindings(string xml, string moduleName = null);

        /// <summary>
        /// Unloads a bindings from the specified xml module.
        /// </summary>
        /// <param name="moduleName">The specified xml module.</param>
        void UnloadBindings(string moduleName);
    }
}